<?php /* Smarty version 2.6.16, created on 2013-09-05 10:07:12
         compiled from ../templates/admin/cms/editcms.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'return_fetched_value', '../templates/admin/cms/editcms.tpl', 56, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => $this->_tpl_vars['header_start'], 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
  echo '<script src="';  echo $this->_tpl_vars['siteroot'];  echo '/includes/js/admin/addcms.js" type="text/javascript"></script><script src="';  echo $this->_tpl_vars['siteroot'];  echo '/includes/js/common.js" type="text/javascript"></script>'; ?>

<?php echo '
<script type="text/javascript">
function replaceNbsps(str) {
 // var re = new RegExp(String.fromCharCode(160), "g");
  return str.replace(/&nbsp;/ig, "");
}

function checksubmit() 
{    
	var isvalid = false;
	isvalid = $("#frmaddcms").valid();
	
	if(isvalid==true)
	{    
		var FCKGetInstance = FCKeditorAPI.GetInstance(\'submenu_content\');  
		var getText = FCKGetInstance.EditorDocument.body.innerHTML; 
		var StripTag = getText.replace(/(<([^>]+)>)/ig,"");
		var newStripTag = replaceNbsps(StripTag);	
		
		if(isWhitespace(newStripTag)) 
		{
			alert("Menu Content should not be blank!");
			return false;
		}            
	}
}
</script>

'; ?>

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => $this->_tpl_vars['header_end'], 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

 <div class="contain">
 
      <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => $this->_tpl_vars['left_menu'], 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
      
      <div class="right_contain">
        
         <div class="heading_box">Edit CMS</div>
         <div class="whitebox">
         <!--Message Div Start-->
          <?php if ($this->_tpl_vars['msg']): ?>
         <div class="masg_div">
        
          	<?php echo $this->_tpl_vars['msg']; ?>

         
         </div>
         <?php endif; ?>
         <!--Message Div End-->
         
         <form name="frmaddcms" id="frmaddcms" action="" method="post">
         <input type="hidden" id="submenu_id" name="submenu_id" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['cmsArray']['submenu_id'])) ? $this->_run_mod_handler('return_fetched_value', true, $_tmp) : smarty_modifier_return_fetched_value($_tmp)); ?>
" />
         <input type="hidden" id="page" name="page" value="<?php echo $this->_tpl_vars['page']; ?>
" />
         <div>
          <!--Form Contain start-->
           
           <div class="form_fieldbox">
             <dl>
              <dt>Menu Title: <span class="error">*</span></dt>
              <dd><input type="text" class="input" name="submenu_title" id="submenu_title" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['cmsArray']['submenu_title'])) ? $this->_run_mod_handler('return_fetched_value', true, $_tmp) : smarty_modifier_return_fetched_value($_tmp)); ?>
"/></dd>
              <div class="clear"></div>
             </dl>
             <dl>
              <dt>Menu Content : <span class="error">*</span></dt>
              <dd><?php 
              	
                $cmsObj = new Model_CMS();
              	$submenu_id=base64_decode($_GET['id']);
              
			  	$cmsresult=$cmsObj->getSubmenuDetailsById($submenu_id);
              
             	include_once(INCLUDE_FCKEDITOR);
                $sBasePath 			= 	$_SERVER[ 'PHP_SELF' ] ;
                $sBasePath			=	FCKEDITOR_BASEPATH;
                $oFCKeditor 		= 	new FCKeditor('submenu_content');
                $oFCKeditor->BasePath 	= 	$sBasePath;
                $oFCKeditor->Height = '500' ;
                $oFCKeditor->Width = '650' ;
                $oFCKeditor->Value	=	$cmsresult['submenu_content'];						
                $oFCKeditor->Create();
               ?></dd>              
              <div id="descriptiondv"></div>
              <div class="clear"></div>
             </dl>
           	
            <!--<dl>
              <dt>Meta Title: <span class="error">*</span></dt>
              <dd><textarea class="input" name="meta_title" id="meta_title"><?php echo ((is_array($_tmp=$this->_tpl_vars['cmsArray']['meta_title'])) ? $this->_run_mod_handler('return_fetched_value', true, $_tmp) : smarty_modifier_return_fetched_value($_tmp)); ?>
</textarea></dd>
              <div class="clear"></div>
            </dl>
             
            <dl>
              <dt>Meta Keyword: <span class="error">*</span></dt>
              <dd><textarea class="input" name="meta_keyword" id="meta_keyword"><?php echo ((is_array($_tmp=$this->_tpl_vars['cmsArray']['meta_keyword'])) ? $this->_run_mod_handler('return_fetched_value', true, $_tmp) : smarty_modifier_return_fetched_value($_tmp)); ?>
</textarea></dd>
              <div class="clear"></div>
            </dl>
            
             <dl>
              <dt>Meta description: <span class="error">*</span></dt>
              <dd><textarea class="input" name="meta_description" id="meta_description"><?php echo ((is_array($_tmp=$this->_tpl_vars['cmsArray']['meta_description'])) ? $this->_run_mod_handler('return_fetched_value', true, $_tmp) : smarty_modifier_return_fetched_value($_tmp)); ?>
</textarea></dd>
              <div class="clear"></div>
            </dl>-->
            
              <dt>&nbsp;</dt>
            
              <div class="clear"></div>
             </dl>
            </div>
            
            <!--Form Contain end--> 
          
           <!--Button here start-->
           <div>
            <span><input type="submit" class="admin_btn" value="Submit" name="editcms_btn" id="editcms_btn" onclick="javascript: return checksubmit();" /></span>
            <span><input type="button" class="admin_btn" value="Cancel" onclick="window.location='<?php echo $this->_tpl_vars['siteroot']; ?>
/admin/home.php?q=cms&page=<?php echo $_GET['page']; ?>
';"/></span>
           </div>
            <!--Button here end-->
  
         </div>
         </form>
         
         </div>
        </div>
      
      
      <!--right_contain end-->
      <div class="clear"></div>
    </div>
    
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => $this->_tpl_vars['footer'], 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>